package com.jprocms.module.cms.enums;

import java.util.Arrays;

/**
 * @author jprocms
 */
public enum EnumContentPushType {

    COPY(1, "复制"), LINK(2, "引用");
    private Integer type;
    private String desc;

    EnumContentPushType(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static EnumContentPushType getByType(Integer collectType) {
        return Arrays.stream(EnumContentPushType.values())
                .filter(item -> item.getType().equals(collectType)).findFirst().orElse(null);
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static boolean isQuote(Integer type) {
        return LINK.type.equals(type);
    }
}
